package com.yt.calendar.controller;


import com.yt.calendar.dto.PlanDto;
import com.yt.calendar.service.IPlanService;
import com.yt.calendar.vo.ResponseVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author yt
 * @since 2021-07-16
 */
@RestController
@RequestMapping("/calendar/plan")
public class PlanController {
    @Resource
    private IPlanService iPlanService;

    /**
     * 描述：更新plan记录
     * @param planDto planDto，计划id和标题
     * @return "com.yt.calendar.vo.ResponseVo"
     * @date 2021/7/17 16:46
     */
    @PostMapping("/updatePlan")
    public ResponseVo updatePlan(@RequestBody PlanDto planDto) {
        boolean isSuccess = iPlanService.updateByDto(planDto);
        return new ResponseVo(isSuccess ? 1 : 0);
    }
}

